home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Balloons.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  13.2 KB  |  418 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Balloons.a
  3. ;
  4. ;    Contains:    Balloon Help Package Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.0
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1990-1993, 1995-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__BALLOONS__') = 'UNDEFINED' THEN
  19. __BALLOONS__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  25.     include 'Quickdraw.a'
  26.     ENDIF
  27.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  28.     include 'Menus.a'
  29.     ENDIF
  30.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  31.     include 'TextEdit.a'
  32.     ENDIF
  33.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  34.     include 'Errors.a'
  35.     ENDIF
  36.  
  37.  
  38. ;  • constants
  39.  
  40.  
  41. kTopLeftTipPointsLeftVariant    EQU        0
  42. kTopLeftTipPointsUpVariant        EQU        1
  43. kTopRightTipPointsUpVariant        EQU        2
  44. kTopRightTipPointsRightVariant    EQU        3
  45. kBottomRightTipPointsRightVariant EQU    4
  46. kBottomRightTipPointsDownVariant EQU    5
  47. kBottomLeftTipPointsDownVariant    EQU        6
  48. kBottomLeftTipPointsLeftVariant    EQU        7
  49. kBalloonVariantCount            EQU        8
  50. ; typedef SInt16                         BalloonVariant
  51.  
  52.  
  53. hmBalloonHelpVersion            EQU        $0002                ; The real version of the Help Manager 
  54. kHMHelpMenuID                    EQU        -16490                ; Resource ID and menu ID of help menu 
  55. kHMAboutHelpItem                EQU        1                    ; help menu item number of About Balloon Help… 
  56. kHMShowBalloonsItem                EQU        3                    ; help menu item number of Show/Hide Balloons 
  57. kHMHelpID                        EQU        -5696                ; ID of various Help Mgr package resources (in Pack14 range) 
  58. kBalloonWDEFID                    EQU        126                    ; Resource ID of the WDEF proc used in standard balloons 
  59.  
  60.                                                             ; Dialog item template type constant 
  61. helpItem                        EQU        1                    ; key value in DITL template that corresponds to the help item 
  62.  
  63.                                                             ; Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources 
  64. hmDefaultOptions                EQU        0                    ; default options for help manager resources 
  65. hmUseSubID                        EQU        1                    ; treat resID's in resources as subID's of driver base ID (for Desk Accessories) 
  66. hmAbsoluteCoords                EQU        2                    ; ignore window port origin and treat rectangles as absolute coords (local to window) 
  67.  
  68. hmSaveBitsNoWindow                EQU        4                    ; don't create a window, just blast bits on screen. No update event is generated 
  69. hmSaveBitsWindow                EQU        8                    ; create a window, but restore bits behind window when window goes away & generate update event 
  70. hmMatchInTitle                    EQU        16                    ; for hwin resources, match string anywhere in window title string 
  71.  
  72.                                                             ; Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources 
  73. kHMStringItem                    EQU        1                    ; pstring used in resource 
  74. kHMPictItem                        EQU        2                    ; 'PICT' ResID used in resource 
  75. kHMStringResItem                EQU        3                    ; 'STR#' ResID & index used in resource 
  76. kHMTEResItem                    EQU        6                    ; Styled Text Edit ResID used in resource ('TEXT' & 'styl') 
  77. kHMSTRResItem                    EQU        7                    ; 'STR ' ResID used in resource 
  78. kHMSkipItem                        EQU        256                    ; don't display a balloon 
  79. kHMCompareItem                    EQU        512                    ; Compare pstring in menu item w/ PString in resource item ('hmnu' only) 
  80. kHMNamedResourceItem            EQU        1024                ; Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) 
  81. kHMTrackCntlItem                EQU        2048                ; Reserved 
  82.  
  83.                                                             ; Constants for hmmHelpType's when filling out HMMessageRecord 
  84. khmmString                        EQU        1                    ; help message contains a PString 
  85. khmmPict                        EQU        2                    ; help message contains a resource ID to a 'PICT' resource 
  86. khmmStringRes                    EQU        3                    ; help message contains a res ID & index to a 'STR#' resource 
  87. khmmTEHandle                    EQU        4                    ; help message contains a Text Edit handle 
  88. khmmPictHandle                    EQU        5                    ; help message contains a Picture handle 
  89. khmmTERes                        EQU        6                    ; help message contains a res ID to 'TEXT' & 'styl' resources 
  90. khmmSTRRes                        EQU        7                    ; help message contains a res ID to a 'STR ' resource 
  91. kHMEnabledItem                    EQU        0                    ; item is enabled, but not checked or control value = 0 
  92.  
  93.                                                             ; ResTypes for Styled TE Handles in Resources 
  94. kHMTETextResType                EQU        'TEXT'                ; Resource Type of text data for styled TE record w/o style info 
  95. kHMTEStyleResType                EQU        'styl'                ; Resource Type of style information for styled TE record 
  96.  
  97. kHMDisabledItem                    EQU        1                    ; item is disabled, grayed in menus or disabled in dialogs 
  98. kHMCheckedItem                    EQU        2                    ; item is enabled, and checked or control value = 1 
  99. kHMOtherItem                    EQU        3                    ; item is enabled, and control value > 1 
  100.                                                             ; Method parameters to pass to HMShowBalloon 
  101. kHMRegularWindow                EQU        0                    ; Create a regular window floating above all windows 
  102. kHMSaveBitsNoWindow                EQU        1                    ; Just save the bits and draw (for MDEF calls) 
  103. kHMSaveBitsWindow                EQU        2                    ; Regular window, save bits behind, AND generate update event 
  104.  
  105.                                                             ; Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages 
  106. kHMMenuResType                    EQU        'hmnu'                ; ResType of help resource for supporting menus 
  107. kHMDialogResType                EQU        'hdlg'                ; ResType of help resource for supporting dialogs 
  108. kHMWindListResType                EQU        'hwin'                ; ResType of help resource for supporting windows 
  109. kHMRectListResType                EQU        'hrct'                ; ResType of help resource for rectangles in windows 
  110. kHMOverrideResType                EQU        'hovr'                ; ResType of help resource for overriding system balloons 
  111. kHMFinderApplResType            EQU        'hfdr'                ; ResType of help resource for custom balloon in Finder 
  112. HMStringResType            RECORD 0
  113. hmmResID                 ds.w    1                ; offset: $0 (0)
  114. hmmIndex                 ds.w    1                ; offset: $2 (2)
  115. sizeof                     EQU *                    ; size:   $4 (4)
  116.                         ENDR
  117. HMMessageRecord            RECORD 0
  118. hmmHelpType                 ds.w    1                ; offset: $0 (0)
  119. hmmString                 ds        Str255            ; offset: $2 (2)
  120.                          ORG 2
  121. hmmPict                     ds.w    1                ; offset: $2 (2)
  122.                          ORG 2
  123. hmmTEHandle                 ds.l    1                ; offset: $2 (2)
  124.                          ORG 2
  125. hmmStringRes             ds        HMStringResType ; offset: $2 (2)
  126.                          ORG 2
  127. hmmPictRes                 ds.w    1                ; offset: $2 (2)
  128.                          ORG 2
  129. hmmPictHandle             ds.l    1                ; offset: $2 (2)
  130.                          ORG 2
  131. hmmTERes                 ds.w    1                ; offset: $2 (2)
  132.                          ORG 2
  133. hmmSTRRes                 ds.w    1                ; offset: $2 (2)
  134.                          ORG 258
  135. sizeof                     EQU *                    ; size:   $102 (258)
  136.                         ENDR
  137. ; typedef struct HMMessageRecord *        HMMessageRecPtr
  138.  
  139. ;   Public Interfaces  
  140. ;
  141. ; pascal OSErr HMGetHelpMenuHandle(MenuHandle *mh)
  142. ;
  143.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  144.         Macro
  145.         _HMGetHelpMenuHandle
  146.             move.w              #$0200,D0
  147.             dc.w                $A830
  148.         EndM
  149.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  150.         IMPORT_CFM_FUNCTION HMGetHelpMenuHandle
  151.     ENDIF
  152.  
  153. ;
  154. ; pascal OSErr HMShowBalloon(const HMMessageRecord *inHelpMessage, Point inTip, Rect *inHotRect, TipFunctionUPP inTipProc, SInt16 inWindowProcID, BalloonVariant inBalloonVariant, SInt16 inMethod)
  155. ;
  156.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  157.         Macro
  158.         _HMShowBalloon
  159.             move.w              #$0B01,D0
  160.             dc.w                $A830
  161.         EndM
  162.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  163.         IMPORT_CFM_FUNCTION HMShowBalloon
  164.     ENDIF
  165.  
  166. ;
  167. ; pascal OSErr HMShowMenuBalloon(SInt16 itemNum, SInt16 itemMenuID, SInt32 itemFlags, SInt32 itemReserved, Point tip, RectPtr alternateRect, TipFunctionUPP tipProc, SInt16 theProc, BalloonVariant balloonVariant)
  168. ;
  169.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  170.         Macro
  171.         _HMShowMenuBalloon
  172.             move.w              #$0E05,D0
  173.             dc.w                $A830
  174.         EndM
  175.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  176.         IMPORT_CFM_FUNCTION HMShowMenuBalloon
  177.     ENDIF
  178.  
  179. ;
  180. ; pascal OSErr HMRemoveBalloon(void )
  181. ;
  182.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  183.         Macro
  184.         _HMRemoveBalloon
  185.             move.w              #$0002,D0
  186.             dc.w                $A830
  187.         EndM
  188.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  189.         IMPORT_CFM_FUNCTION HMRemoveBalloon
  190.     ENDIF
  191.  
  192. ;
  193. ; pascal OSErr HMGetIndHelpMsg(ResType inWhichResType, SInt16 inWhichResID, SInt16 inMessageIndex, SInt16 inMessageState, UInt32 *outOptions, Point *outTip, Rect *outHotRect, SInt16 *outWindowProcID, BalloonVariant *outBalloonVariant, HMMessageRecord *outHelpMessage, SInt16 *outMessageCount)
  194. ;
  195.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  196.         Macro
  197.         _HMGetIndHelpMsg
  198.             move.w              #$1306,D0
  199.             dc.w                $A830
  200.         EndM
  201.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  202.         IMPORT_CFM_FUNCTION HMGetIndHelpMsg
  203.     ENDIF
  204.  
  205. ;
  206. ; pascal Boolean HMIsBalloon(void )
  207. ;
  208.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  209.         Macro
  210.         _HMIsBalloon
  211.             move.w              #$0007,D0
  212.             dc.w                $A830
  213.         EndM
  214.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  215.         IMPORT_CFM_FUNCTION HMIsBalloon
  216.     ENDIF
  217.  
  218. ;
  219. ; pascal Boolean HMGetBalloons(void )
  220. ;
  221.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  222.         Macro
  223.         _HMGetBalloons
  224.             move.w              #$0003,D0
  225.             dc.w                $A830
  226.         EndM
  227.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  228.         IMPORT_CFM_FUNCTION HMGetBalloons
  229.     ENDIF
  230.  
  231. ;
  232. ; pascal OSErr HMSetBalloons(Boolean flag)
  233. ;
  234.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  235.         Macro
  236.         _HMSetBalloons
  237.             move.w              #$0104,D0
  238.             dc.w                $A830
  239.         EndM
  240.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  241.         IMPORT_CFM_FUNCTION HMSetBalloons
  242.     ENDIF
  243.  
  244. ;
  245. ; pascal OSErr HMSetFont(SInt16 font)
  246. ;
  247.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  248.         Macro
  249.         _HMSetFont
  250.             move.w              #$0108,D0
  251.             dc.w                $A830
  252.         EndM
  253.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  254.         IMPORT_CFM_FUNCTION HMSetFont
  255.     ENDIF
  256.  
  257. ;
  258. ; pascal OSErr HMSetFontSize(UInt16 fontSize)
  259. ;
  260.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  261.         Macro
  262.         _HMSetFontSize
  263.             move.w              #$0109,D0
  264.             dc.w                $A830
  265.         EndM
  266.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  267.         IMPORT_CFM_FUNCTION HMSetFontSize
  268.     ENDIF
  269.  
  270. ;
  271. ; pascal OSErr HMGetFont(SInt16 *font)
  272. ;
  273.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  274.         Macro
  275.         _HMGetFont
  276.             move.w              #$020A,D0
  277.             dc.w                $A830
  278.         EndM
  279.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  280.         IMPORT_CFM_FUNCTION HMGetFont
  281.     ENDIF
  282.  
  283. ;
  284. ; pascal OSErr HMGetFontSize(UInt16 *fontSize)
  285. ;
  286.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  287.         Macro
  288.         _HMGetFontSize
  289.             move.w              #$020B,D0
  290.             dc.w                $A830
  291.         EndM
  292.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  293.         IMPORT_CFM_FUNCTION HMGetFontSize
  294.     ENDIF
  295.  
  296. ;
  297. ; pascal OSErr HMSetDialogResID(SInt16 resID)
  298. ;
  299.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  300.         Macro
  301.         _HMSetDialogResID
  302.             move.w              #$010C,D0
  303.             dc.w                $A830
  304.         EndM
  305.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  306.         IMPORT_CFM_FUNCTION HMSetDialogResID
  307.     ENDIF
  308.  
  309. ;
  310. ; pascal OSErr HMSetMenuResID(SInt16 menuID, SInt16 resID)
  311. ;
  312.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  313.         Macro
  314.         _HMSetMenuResID
  315.             move.w              #$020D,D0
  316.             dc.w                $A830
  317.         EndM
  318.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  319.         IMPORT_CFM_FUNCTION HMSetMenuResID
  320.     ENDIF
  321.  
  322. ;
  323. ; pascal OSErr HMBalloonRect(const HMMessageRecord *inMessage, Rect *outRect)
  324. ;
  325.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  326.         Macro
  327.         _HMBalloonRect
  328.             move.w              #$040E,D0
  329.             dc.w                $A830
  330.         EndM
  331.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  332.         IMPORT_CFM_FUNCTION HMBalloonRect
  333.     ENDIF
  334.  
  335. ;
  336. ; pascal OSErr HMBalloonPict(const HMMessageRecord *inMessage, PicHandle *outPict)
  337. ;
  338.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  339.         Macro
  340.         _HMBalloonPict
  341.             move.w              #$040F,D0
  342.             dc.w                $A830
  343.         EndM
  344.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  345.         IMPORT_CFM_FUNCTION HMBalloonPict
  346.     ENDIF
  347.  
  348. ;
  349. ; pascal OSErr HMScanTemplateItems(SInt16 whichID, SInt16 whichResFile, ResType whichType)
  350. ;
  351.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  352.         Macro
  353.         _HMScanTemplateItems
  354.             move.w              #$0410,D0
  355.             dc.w                $A830
  356.         EndM
  357.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  358.         IMPORT_CFM_FUNCTION HMScanTemplateItems
  359.     ENDIF
  360.  
  361. ;
  362. ; pascal OSErr HMExtractHelpMsg(ResType inType, SInt16 inResID, SInt16 inMessageIndex, SInt16 inMessageState, HMMessageRecord *outMessage)
  363. ;
  364.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  365.         Macro
  366.         _HMExtractHelpMsg
  367.             move.w              #$0711,D0
  368.             dc.w                $A830
  369.         EndM
  370.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  371.         IMPORT_CFM_FUNCTION HMExtractHelpMsg
  372.     ENDIF
  373.  
  374. ;
  375. ; pascal OSErr HMGetDialogResID(SInt16 *resID)
  376. ;
  377.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  378.         Macro
  379.         _HMGetDialogResID
  380.             move.w              #$0213,D0
  381.             dc.w                $A830
  382.         EndM
  383.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  384.         IMPORT_CFM_FUNCTION HMGetDialogResID
  385.     ENDIF
  386.  
  387. ;
  388. ; pascal OSErr HMGetMenuResID(SInt16 menuID, SInt16 *resID)
  389. ;
  390.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  391.         Macro
  392.         _HMGetMenuResID
  393.             move.w              #$0314,D0
  394.             dc.w                $A830
  395.         EndM
  396.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  397.         IMPORT_CFM_FUNCTION HMGetMenuResID
  398.     ENDIF
  399.  
  400. ;
  401. ; pascal OSErr HMGetBalloonWindow(WindowPtr *window)
  402. ;
  403.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  404.         Macro
  405.         _HMGetBalloonWindow
  406.             move.w              #$0215,D0
  407.             dc.w                $A830
  408.         EndM
  409.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  410.         IMPORT_CFM_FUNCTION HMGetBalloonWindow
  411.     ENDIF
  412.  
  413.  
  414.  
  415.  
  416.     ENDIF ; __BALLOONS__ 
  417.  
  418.